package com.action.mail;

import com.db.mail.*;

public class Move_MailAction {

	private int r_email_num;
	private String choose;
	private String recoverValue;

	public void setRecoverValue(String recoverValue) {
		this.recoverValue = recoverValue;
	}

	public void setChoose(String choose) {
		this.choose = choose;
	}

	public void setR_email_num(int r_email_num) {
		this.r_email_num = r_email_num;
	}

	public String move() throws Exception {

		MailDAO.moveGetData(r_email_num);

		return "success";
	}

	public String moves() throws Exception {

		String[] num = choose.split("-");
		for (int i = 0; i < num.length; i++) {
			MailDAO.moveGetData(Integer.parseInt(num[i]));
		}
		return "success";
	}

	public String recover() throws Exception {

		MailDAO.recoverGetData(r_email_num);

		return "success";
	}

	public String recoverAll() throws Exception {
		
		String[] num = recoverValue.split("-");
		for (int i = 0; i < num.length; i++) {
			MailDAO.recoverGetData(Integer.parseInt(num[i]));
			System.out.println(num[i]);
		}

		return "success";
	}
}
